<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>头像上传成功</title>
</head>
<body>
<?php
print_r($_FILES);
$oldName =$_FILES['file']['name'];
$arr = explode('.',$oldName);
$newName =md5($oldName.time()).'.'.$arr[count($arr)-1];
echo $newName;
move_uploaded_file($_FILES['file']['tmp_name'],'image/'.$newName);
move_uploaded_file($_FILES['file']['tmp_name'],$oldName);
$img_url = 'assignment/image/'.$newName;
?>
<label>你的头像是:</label>
<img src = "<?php echo $img_url; ?>">;
</body>
</html>
